import axios from '@/utils/axios'
import apis from '@/apis'

const state ={
	allGames:[]
}
const mutations = {
	LOADALLGAMES(state,payload){
		state.allGames = payload
	}
}

const getters = {
	allGames(state){
		return state.allGames;
	}
}

var actions = {
	loadAllPermission({commit},payload){
		axios.get(apis.findAllPermission)
		.then((resp)=>{
			console.log(resp)
		})
	},
	loadAllGames({commit},payload){
		axios.get(apis.findAllGames)
		.then((resp)=>{
			commit('LOADALLGAMES',resp.data.data[0].games)
		})
	}
}

export default{
	state,
	mutations,
	getters,
	actions
}
